package com.android.dumiaogou.model.auction;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.zhy.http.okhttp.callback.Callback;

import okhttp3.Response;

/**
 * Created by Administrator on 2017/10/19.
 */

public abstract class Orderts_HistoryDataCallback extends Callback<Orderts_HistoryData> {

    @Override
    public Orderts_HistoryData parseNetworkResponse(Response response, int id) throws Exception {
        String string = response.body().string();
        GsonBuilder builder = new GsonBuilder();
        builder.registerTypeAdapter(Orderts_HistoryData.class, new Orderts_HistoryData.Orderts_HistoryDataDeserializer());
        Gson gson = builder.create();
        Orderts_HistoryData data = gson.fromJson(string, Orderts_HistoryData.class);
//        Orderts_HistoryData data = new Gson().fromJson(string,Orderts_HistoryData.class);
        return data;
    }
}
